Hi Ross,
Yes that is already the way it works. Even though there is only one C file to do the homing, Mach3 passes a "flags" variable that tells the C file which axis it is supposed to home. flags = 1 indicates it should home X, flags = 2 indicates Y and flags = 4 indicates Z. The C file normally does a "switch" statement based on the flag variable to switch to the portion of code to home only the indicated axis.
Maybe I'm missing your point. Did you mean to say "Home" or "Set Home"? What is exactly happening and what is your desired behaviour?
Thanks
TK
| Group: DynoMotion |
Message: 591 |
From: Ross Ferguson |
Date: 8/16/2010 |
| Subject: Re: Lathe Homing Routine |
The button terminology in Mach3Turn is different from Mach3Mill.
Set Home, in Mach3Turn, has a similar effect to Ref All Home in
Mach3Mill.
So, if I want to "Home" the lathe axes I must click on Set Home X
and, the way the C file is configured, both axes will go to their
Home position, but only the X Refd/Homed light will turn green.
I must then click on Set Home Z and both axes will Home once again
and then the Z Refd/Homed light will turn green.
So how does Mach3Turn know which switch is which?
In Mach3Turn the Home All button just means that it will set the
Home position for both axes wherever they are at the moment that
button is activated - it has nothing to do with physical Homing
limit switches.
Only the Set Home buttons relate to Homing switches.
I would like Mach3Turn to know that when I press the Set Home X
button it is just the X axis that is moving.
Same with the Set Home Z.
I hope I have made that a little more lucid :)
Ross
On 16/08/2010 3:56 PM, Tom Kerekes wrote:
Hi Ross,
Yes that is already the way it works. Even though
there is only one C file to do the homing, Mach3 passes
a "flags" variable that tells the C file which axis it
is supposed to home. flags = 1 indicates it should home
X, flags = 2 indicates Y and flags = 4 indicates Z. The
C file normally does a "switch" statement based on the
flag variable to switch to the portion of code to home
only the indicated axis.
Maybe I'm missing your point. Did you mean to say
"Home" or "Set Home"? What is exactly happening and
what is your desired behaviour?
Thanks
TK
| Group: DynoMotion |
Message: 592 |
From: Tom Kerekes |
Date: 8/16/2010 |
| Subject: Re: Lathe Homing Routine |
Hi Ross,
Ok that helps. I think the problem is that the C program is ignoring what Mach3 is telling it to do and always homing both axes. Mach3 doesn't know anything about the switches. When you push the "Set Home X" button it tells the Plugin/C Program to home the X axis by setting the "flags" parameter to 1. But then your C program is probably not checking the "flags" variable at all, but just homing both axes. Mach3 then assumes since it told us to home X that X has now been referenced, so it sets the X LED.
Take a look at the HomeMach3.c program. Find the comment line that says "// do x homing here". Now open your xz homing program and identify the lines of code that do the x homing. Copy/paste the code after the comment. Do the same for the z (but paste the z code after the z comment).
Now configure Mach3 for the new homing program you created and test. If youhave the KMotion console window open it should print the appropriate "flags" variable (1 or 4). If not, make sure you are configured to use variable 5 which is what the example Mach3Home.c is expecting the "flags" value to be passed in.
I hope this helps.
TK
| Group: DynoMotion |
Message: 593 |
From: fermanz |
Date: 8/16/2010 |
| Subject: Re: Lathe Homing Routine |
Thanks Tom,
I understand what you are saying but I am not sure how to implement it.
I know how to do the KMotion part with the HomeMach3.c but I am lost with "Now open your xz homing program".
I presume that it is in Mach3Turn - is that correct?
I'm hoping you'll tell me how to find it. :)
Once found, I think I follow what you have said -
#1 Copy appropriate code from HomeMach3.c
#2 Paste said code to xz homing program.
Not vice versa?
Ross
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ross,
>
> Ok that helps. I think the problem is that the C program is ignoring what Mach3
> is telling it to do and always homing both axes. Mach3 doesn't know anything
> about the switches. When you push the "Set Home X" button it tells the Plugin/C
> Program to home the X axis by setting the "flags" parameter to 1. But then your
> C program is probably not checking the "flags" variable at all, but just homing
> both axes. Mach3 then assumes since it told us to home X that X has now been
> referenced, so it sets the X LED.
>
> Take a look at the HomeMach3.c program. Find the comment line that says "//
> do x homing here". Now open your xz homing program and identify the lines of
> code that do the x homing. Copy/paste the code after the comment. Do the same
> for the z (but paste the z code after the z comment).
>
> Now configure Mach3 for the new homing program you created and test. If youhave
> the KMotion console window open it should print the appropriate "flags" variable
> (1 or 4). If not, make sure you are configured to use variable 5 which is what
> the example Mach3Home.c is expecting the "flags" value to be passed in.
>
> I hope this helps.
> TK
>
>
> Â
>
>
>
> ________________________________
> From: Ross Ferguson <ferman@...>
> To: DynoMotion@yahoogroups.com
> Sent: Mon, August 16, 2010 1:22:35 AM
> Subject: Re: [DynoMotion] Lathe Homing Routine
>
> Â
> The button terminology in Mach3Turn is different from Mach3Mill.
> Set Home, in Mach3Turn, has a similar effect to Ref All Home in Mach3Mill.
>
> So, if I want to "Home" the lathe axes I must click on Set Home X and, the way
> the C file is configured, both axes will go to their Home position, but only the
> X Refd/Homed light will turn green.
>
> I must then click on Set Home Z and both axes will Home once again and then the
> Z Refd/Homed light will turn green.
>
> So how does Mach3Turn know which switch is which?
>
> In Mach3Turn the Home All button just means that it will set the Home position
> for both axes wherever they are at the moment that button is activated - it has
> nothing to do with physical Homing limit switches.
> Only the Set Home buttons relate to Homing switches.
>
> I would like Mach3Turn to know that when I press the Set Home X button it is
> just the X axis that is moving.
> Same with the Set Home Z.
>
> I hope I have made that a little more lucid :)
>
> Ross
>
> On 16/08/2010 3:56 PM, Tom Kerekes wrote:
> Â
> >Hi Ross,
> >
> >Yes that is already the way it works. Even though there is only one C file to
> >do the homing, Mach3 passes a "flags" variable that tells the C file which axis
> >it is supposed to home. flags = 1 indicates it should home X, flags = 2
> >indicates Y and flags = 4 indicates Z. The C file normally does a "switch"
> >statement based on the flag variable to switch to the portion of code to home
> >only the indicated axis.
> >
> >Maybe I'm missing your point. Did you mean to say "Home" or "Set Home"? What
> >is exactly happening and what is your desired behaviour?
> >
> >Thanks
> >TK
> >
> >
> >
> >
> ________________________________
> From: fermanz <ferman@...>
> >To: DynoMotion@yahoogroups.com
> >Sent: Sun, August 15, 2010 5:16:49 PM
> >Subject: [DynoMotion] Lathe Homing Routine
> >
> >Â
> >Hi Tom,
> >Would it be possible to extend the Home User Program, for Mach3Turn, to two
> >sections in the Mach3 Plugin Control & Activation?
> >
> >Mach3Turn has separate Set Home X and Set Home Z functions in the Machine
> >Coords.
> >
> >Both must be set separately by using the single Home User Program, where the C
> >file includes both axes.
> >
> >From my reading these settings are required for the various offsets and tooling
> >calculations for tools in the tool table.
> >
> >From that I am presuming that homing each axis with their own routine would be
> >advantageous.
> >
> >Please let me know what you think.
> >Ross
> >
> >
>
> -- Ferguson Windmills Company 835 Old North Road, R.D.2, Waimauku, New
> Zealand. 0882 Ph 64 9 411 8332 Mobile 027 282 7689 Fax 64 9 412 8655
> E-mail - ferman@... http://www.windmills.co.nz
>
|
|
| Group: DynoMotion |
Message: 594 |
From: Tom Kerekes |
Date: 8/16/2010 |
| Subject: Re: Lathe Homing Routine |
Hi Ross,
No the other way around. Use the HomeMach3.c as an empty skeleton, and paste the pieces of meat from your working homing program into it.
TK
| | | | | | | |